package com.spring.test;

import com.spring.bean.Emp;
import com.spring.config.MyBatisConfig;
import com.spring.service.EmpService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.List;

public class App {
    public static void main(String[] args) {
        ApplicationContext beans=new AnnotationConfigApplicationContext(MyBatisConfig.class);
//        ApplicationContext beans=new AnnotationConfigApplicationContext("com.spring.config");
        EmpService empService = beans.getBean(EmpService.class);
        List<Emp> list = empService.findAllEmp();
        for (Emp emp:list){
            System.out.println(emp);
        }

    }
}
